$(document).ready(function(){
	$("a.empty").click(function(){
		if(confirm("Are you sure?")){
			return true;
		}else{
			return false;
		}
	});
	$(".hachange").change(function(){
		stt = $(this).attr('title');
		number = $(this).val();
		rowid = $("#idpro"+stt).val();
		adult = $("#adult"+stt).val();
		child = $("#child"+stt).val();
		servi = $("#service"+stt).val();
		costi = $("#cost"+stt);hatotal = $("#hatotal"+stt);
		price = $("#price"+stt).val();
		totaladu = adult*price;
		totalchi = child*servi;
		totalcos = parseFloat(totaladu) + parseFloat(totalchi);
		hatotal.val(totalcos);
		costi.html("$"+totalcos);
		abc = 0;
		$(".hatotal").each(function(){
			val = $(this).val();
			abc = parseFloat(abc) +  parseFloat(val);
		});
		/*jQuery.post(links+"home/cart/updatecart",{rowid:rowid,number:number,adult:adult,child:child,subtotal:totalcos,price:totalcos,service:servi},function(result){
			//alert(result);
		});*/
		$("#totalall").val(abc);
		$("#TotalFare").html("Total fare: $"+abc);
		
	});
});